#ifndef STEREOVISION_H
#define STEREOVISION_H

#include <QWidget>
#include "camera.h"
#include "object.h"

// this Object is designed to show two OpenGL windows for viewing
//   by stereo rendering.
// another Qt object could connect to the slot of this class to dynamically
// change the viewing parameters
class StereoVision : public QObject
{
    Q_OBJECT
public:
    StereoVision( QObject *parent = 0 );
    ~StereoVision();
signals:
    void cameraUpdated();
public slots:
    void updateCamera( XYZ eye, XYZ up, XYZ focus )
    {
        _camera->vp = eye;
        _camera->vu = up;
        _camera->vd = Utility::Direction( &eye, &focus );
        _obj_l->updateGL();
        _obj_r->updateGL();
        emit cameraUpdated();
    }
//    void updateCamera( XYZ eye )
//    {
//        _camera->vp = eye;
//        _camera->vu = up;
//        _camera->vd = Utility::Direction( &eye, &focus );
//        _obj_l->updateGL();
//        _obj_r->updateGL();
//        emit cameraUpdated();
//    }
private:
    camera::Camera * _camera;
    MyGLObject * _obj_l, * _obj_r;
};

#endif // STEREOVISION_H
